{%- extends 'index.html' -%}
{%- block body -%}
    <div class="post clearfix">
        <div class="row">
            <div class="col-lg-8">
                <div class="page-header">
                    <h1>Login</h1>
                </div>
                <div class="content">
                    {%- with messages = get_flashed_messages(with_categories=True) -%}
                        {%- if messages -%}
                            {%- for category, message in messages -%}
                                <div class="response">
                                    <span class="message {{ category }}">{%- if category == 'success' -%}✔{%- endif -%}&nbsp;{{ message }}</span>
                                </div>
                            {%- endfor -%}
                        {%- endif -%}
                    {%- endwith -%}
                    <form role="form" method="post" action="{{ url_for('login') }}">
                        <div class="form-group {% if error and error_type == 'validate' %}has-error{% endif %}">
                            {%- if error and error_type == 'validate' -%}
                                <label class="control-label" for="login-username">Required field</label>
                            {%- endif -%}
                            <input type="text" class="form-control" name="login-username" id="login-username" placeholder="Username" required autocomplete="off">
                        </div>
                        <div class="form-group {% if error and error_type == 'validate' %}has-error{% endif %}">
	                        {%- if error and error_type == 'validate' -%}
                                <label class="control-label" for="login-password">Required field</label>
                            {%- endif -%}
                            <input type="password" class="form-control" name="login-password" id="login-password" placeholder="Password" required autocomplete="off">
                        </div>
                        <div class="form-group">
                            <input name="_csrf_token" type="hidden" value="{{ csrf_token() }}">
                            <input type="submit" class="btn btn-primary" value="Submit">
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
{%- endblock -%}
